import pyautogui
import time
import xlrd
import pyperclip

def printPoint():
    # 打印chrome图片位置.
    location = pyautogui.locateCenterOnScreen("chrome.png", confidence=0.9);
    if location is not None:
        print("chrome位置：",location.x, location.y);
        pyautogui.click(location.x, location.y, clicks=2, interval=0.2, duration=0.2, button='left');

    time.sleep(0.5);
    location = pyautogui.locateCenterOnScreen("chrome_input_fill.png", confidence=0.9);
    if location is not None:
        print("chrome位置：", location.x, location.y);
        pyautogui.click(location.x, location.y, clicks=1, interval=0.2, duration=0.2, button='left');

    time.sleep(1);
    pyperclip.copy("python");
    pyautogui.hotkey('ctrl', 'v');

if __name__ == '__main__':
    while True:
        printPoint();
        time.sleep(1.5);